import $ = require("jquery")

const class_name: string = "global_loading";

/** 开启全局加载进度 */
function open() {
    let div = $(`body .${class_name}`);
    if (div.length <= 0) {
        div = $(document.createElement("div"));
        div.addClass(class_name)
        $("body").append(div);
    }
}
/** 关闭全局加载进度 */
function close() {
    $(`body .${class_name}`).remove();
}

export default {
    open,
    close,
}
